﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SimpleData.ObjectModel.Design;
using Moq;

namespace SimpleData
{
	public static class RuleBuilderExtensions
	{

		public static MockBuilder<IRuleBuilder> RuleBuilder( this IMockInit init )
		{
			return new MockBuilder<IRuleBuilder>();
		}

		public static MockBuilder<IRuleBuilder> CallBuild( this MockBuilder<IRuleBuilder> builder, Action<ValidatorBuilder> action )
		{
			builder.Mock.Setup( rb => rb.BuildOn( It.IsAny<ValidatorBuilder>() ) ).Callback<ValidatorBuilder>( v => action( v ) );
			return builder;
		}

	}
}
